import { createSSRApp } from 'vue'
import App from './App.vue'
import piniaStore from './store'

import { toPage, goBack } from '@/utils/common.js'
import storage from '@/utils/storage'


// 移动端调试工具 生产环境需要注释
// #ifdef H5
// import Vconsole from 'vconsole'
// let vConsole = new Vconsole();
// #endif

export function createApp() {
	const app = createSSRApp(App)
	//全局挂载跳转页面方法
	app.config.globalProperties.$toPage = toPage
	app.config.globalProperties.$goBack = goBack
	app.config.globalProperties.$storage = storage
	app.config.globalProperties.$oss = import.meta.env.VITE_OSS_BASEURL
	app.use(piniaStore)
	return {
		app
	}
}